
<%@page import="com.qdu.impl.ShoppingCarImpl"%>
<%@page import="java.util.List"%>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD><TITLE>计算机图书网上专营店</TITLE>
        <META http-equiv=Content-Type content="text/html; charset=UTF-8">
        <LINK 
            href=img/ys1.css type=text/css rel=stylesheet>
            <META content="MSHTML 6.00.2900.3059" name=GENERATOR>
        
    </HEAD>
    <%
    String message = (String)request.getAttribute("message");
            if(message == null){
                            message = "";
            }
            if (!message.trim().equals("")){
                    out.println("<script language='javascript'>");
                    out.println("alert('"+message+"');");
                    out.println("</script>");
            }
            request.removeAttribute("message");
	
            String name=(String)session.getAttribute("name");
            if(name!=null){
    %>
    <STYLE>
            #div0{
                width:100%;
                height:50px;
                background-color:#FFCCCC;
                position:fixed;
                z-index:10;
                margin:-10px -10px 0px -10px;
            }
            #top-page{
                float:right;
                height:10px;
                white-space:nowrap;
                margin:25px 0px 0px 0px;

            }	
            #logo{
                height:50px;
                width:50px;
                float:left;
            }
            
        </style>
    <BODY text=#000000 leftMargin=0 topMargin=0 bgColor=#F0FFFF>
        <div id="div0">
            <div id="logo">
                <img src="img/logo.jpg" style="width:100%;height:100%; margin-left:15%">
            </div>
           <div id="top-page" align="right" style="margin-right:5%">
                <div align=center>
                   <a href="/J02_T13_P04/index.jsp"><FONT color=#ffffff>首页</FONT></a><FONT color=#ffffff> │ </FONT>
                    <a href="/J02_T13_P04/newbook.jsp"><FONT color=#ffffff>最新图书</FONT></a><FONT color=#ffffff> │ </FONT>
                    <a href="/J02_T13_P04/fenlei.jsp"><FONT color=#ffffff>图书分类</FONT></a><FONT color=#ffffff> │ </FONT>
                    <a href="/J02_T13_P04/allbooklist.jsp"><FONT color=#ffffff>全部图书</FONT></a><FONT color=#ffffff> │ </FONT>
                    <a href="/J02_T13_P04/admin/login.jsp" target=_blank><FONT color=#ffffff>管理入口</FONT></a>
                </div>
            </div>
        </div>
    <STYLE type=text/css>.style1 {
            COLOR: #ffff00
        }
    </STYLE>

    <TABLE cellSpacing=0 cellPadding=0 width=779 align=center border=0>
        <TBODY>
            <TR>
                <TD width=779 >
                    <img src="img/top.jpg" width="779">
                </TD></TR></TBODY></TABLE>
    <TABLE cellSpacing=0 cellPadding=0 width=779 align=center border=0>
        


    <TABLE cellSpacing=0 cellPadding=0 width=779 align=center
           border=0>
        <script language="javascript">
            function check()
            {
                if (document.form1.login.value == "" || document.form1.email.value == "")
                {
                    alert("必须填写所有项目！");
                    return false;
                }
            }
        </script>
        <TBODY>
            <TR>
                <TD align=center vAlign=top width=779 height=400>

                    <table bgcolor=#99CCCC align=left width=100 border=0 height=400>
                        <tr>
                            <td align=center bordercolor="#CCFFFF" bgcolor="#99CCCC"><a href="upuser.jsp">个人信息</a></td>
                        </tr>
                        <tr>
                            <td align=center bordercolor="#FFFFFF" bgcolor="#99CCCC"><a href="gouwuche.jsp">我的购物车</a></td> 
                        </tr>
                        <tr>
                            <td align=center bordercolor="#FFFFFF" bgcolor="#99CCCC"><a href="shoucangjia.jsp">我的收藏夹</a></td> 
                        </tr>
                        <tr>
                            <td align=center bordercolor="#FFFFFF" bgcolor="#99CCCC"><a href="dingdan.jsp">我的定单</a></td>
                        </tr>
                        <tr>
                            <td align=center bordercolor="#FFFFFF" bgcolor="#99CCCC"><a href="index.jsp">返回首页</a></td>
                        </tr>
                        <tr>
                            <td bordercolor="#FFFFFF" bgcolor="#99CCCC"><a href="">&nbsp;</a></td>
                        </tr>
                        <tr>
                            <td bordercolor="#000000" bgcolor="#99CCCC"><a href="">&nbsp;</a></td>
                        </tr>
                        <tr>
                            <td bordercolor="#000000" bgcolor="#99CCCC"><a href="">&nbsp;</a></td>
                        </tr>
                        <tr>
                            <td bordercolor="#000000" bgcolor="#99CCCC"><a href="">&nbsp;</a></td>
                        </tr>
                        <tr>
                            <td bordercolor="#000000" bgcolor="#99CCCC"><a href="">&nbsp;</a></td>
                        </tr>
                        <tr>
                            <td bordercolor="#000000" bgcolor="#99CCCC"><a href="">&nbsp;</a></td>
                        </tr>
                        <tr>
                            <td bordercolor="#000000" bgcolor="#99CCCC"><a href="">&nbsp;</a></td>
                        </tr>
                    </table>


                    <form action="GouWu.jsp" method="post" name="form1" >
                        <table align=right width=660 border=1 >
                            <tr>
                            <input type=hidden name=method value=sendorder><input type=hidden name=id value=1>
                            <td align="center" colspan="6"><br>
                                <span class="STYLE2">我的购物车</span></td>
                            </tr>
                            <tr>
                                <td align="center" height="30">书名</td>
                                <td align="center" height="30">数量</td>
                                <td align="center" height="30">单价</td>
                                <td align="center" height="30">加入时间</td>
                                <td align="center" height="30">修改</td>
                                <td align="center" height="30">操作</td>
                            </tr>
                            <%
                            List list=new ShoppingCarImpl().getMyGouWuChe(name);
                            if(!list.isEmpty()){
                            float f=0;
                            for(int i=0;i<list.size();i++){
                                    List list2=(List)list.get(i);
                                    f+=Integer.parseInt(list2.get(1).toString())*Float.parseFloat(list2.get(2).toString());
                            %>
                            <tr>
                                <td align="center" height="30"><%=list2.get(0).toString() %></td>
                                <td align="center" height="30"><%=list2.get(1).toString() %></td>
                                <td align="center" height="30"><%=list2.get(2).toString() %></td>
                                <td align="center" height="30"><%=list2.get(3).toString() %></td>
                                <td align="center" height="30"><a href="upgouwu.jsp?id=<%=list2.get(4).toString()%>&shuliang=<%=list2.get(1).toString()%>&shuming=<%=list2.get(0).toString()%>&danjia=<%=list2.get(2).toString()%>">修改</a></td>
                                <td align="center" height="30"><a href="GouWu.jsp?method=delgw&id=<%=list2.get(4).toString() %>">删除</a></td>
                            </tr>
                            <%
                                    }
                            %>
                            <tr><td colspan=6 align=right>总金额:人民币<font color=red><%=f %></font>元</td></tr>
                            <tr>
                                <td align="center" colspan="6">付款方式<select name=fukuanfangshi>
                                        <option value="建设银行">建设银行</option>
                                        <option value="工商银行">工商银行</option>
                                        <option value="农业银行">农业银行</option>
                                        <option value="招商银行">招商银行</option>
                                        <option value="邮局汇款">邮局汇款</option>
                                    </select></td>
                            </tr>
                            <tr>
                                <td align="center" colspan="6"><input type="submit" value="提交定单"></td>
                            </tr>
                            <%
                                    }
                            %>


                        </table>

                    </form>

                </TD>

            </TR></TBODY></TABLE>
<br><br>
<br><br>
<br><br>
<div style="background:#CCFFFF;color:white;height:13;"align=center >2020-2030 网上书店  版权所有</div>
<div style="background:#FFCCCC;color:white;height:13;"align=center >2020-2030 网上书店  版权所有</div>
<div style="background:#CCFFFF;color:white;height:13;"align=center >2020-2030 网上书店  版权所有</div>
</BODY>
<%}else{response.sendRedirect("index.jsp");} %>
</HTML>
